Hashを参照、変更、追加
Top > Ruby [2.2.2] > Hash( [] , []= )
runrun = {:acha=>0, :porute=>1, :piipo=>2} p runrun[:acha] # 1 p runrun[:achacha] # nil p runrun[:porute,:piipo] # `[]': wrong number of arguments(2 for 1) (ArgumentError) ranran = {0=>"acha", 1=>"porute", 2=>"piipo"} p ranran[1] # "porute" p ranran[-1] # nil p ranran[0,2] # `[]': wrong number of arguments(2 for 1) (ArgumentError) p runrun[:porute] = 666 # 666 p runrun[:achacha] = 4 # 4 p runrun # {:acha=>0, :porute=>666, :piipo=>2, :achacha=>4}